//
//  MSCodeBuidingController.m
//  觅尚
//
//  Created by No.8 on 2019/5/4.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSCodeBuidingController.h"

@interface MSCodeBuidingController ()
{
    CustomNavigationBar *naviagtionBar;
    
}
@end

@implementation MSCodeBuidingController

/** Nav实现 */
- (int)navBarBottom {
    if ([WRNavigationBar isIphoneX]) {
        return 88;
    } else {
        return 64;
    }
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createNavigationBar];
    
    [self CreatView];
    
}

- (void)CreatView{
    
    UITextField *SpecialityField = [[UITextField alloc] initWithFrame:CGRectMake(50 * px, [self navBarBottom] + 150 * px, ScreenWidth - 100 * px, 120 * px)];
    SpecialityField.textColor = [UIColor whiteColor];
    SpecialityField.placeholder = @"请输入公司代码";
    [SpecialityField setValue:[UIFont systemFontOfSize:SYRealValue(28 / 2)] forKeyPath:@"_placeholderLabel.font"];
    SpecialityField.backgroundColor = [UIColor clearColor];
    [SpecialityField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
    SpecialityField.layer.borderColor = [UIColor darkGrayColor].CGColor;//设置边框颜色
    SpecialityField.layer.borderWidth = 1.0f;//设置边框颜色
    [SpecialityField.layer setMasksToBounds:YES];
    [self.view addSubview:SpecialityField];
    
    
    /** 确定*/
    UIButton * confirmButton = [[UIButton alloc] initWithFrame:CGRectMake(SpecialityField.x, CGRectGetMaxY(SpecialityField.frame) + 50 * px, SpecialityField.width, 120 * px)];
    confirmButton.layer.cornerRadius = 60 * px;
    confirmButton.layer.masksToBounds = YES;
    [confirmButton setBackgroundImage:[UIImage imageNamed:@"底部按钮背景"] forState:UIControlStateNormal];
    [confirmButton setTitle:@"确定" forState:UIControlStateNormal];
    confirmButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(32 / 2)];
    [confirmButton  setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [confirmButton  addTarget:self action:@selector(confirmButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view  addSubview:confirmButton];
}

- (void)confirmButtonClick{
    
    
}
- (void)createNavigationBar{
    
    self.view.backgroundColor = backgroundcolor;
    naviagtionBar = [[CustomNavigationBar alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, [self navBarBottom])];
    [self.view addSubview:naviagtionBar];
    naviagtionBar.titleLabel.text = @"代码绑定";
    naviagtionBar.rightBtn.hidden = YES;
    naviagtionBar.rightBtnTitle.hidden = YES;
    [self.view addSubview:naviagtionBar];
    
    [naviagtionBar.leftBtn setImage:[UIImage imageNamed:@"左箭头"] forState:UIControlStateNormal];
    [naviagtionBar.leftBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:NO];
}
@end
